<template>
  <div class="register_content">
        <input type="text" class="username" placeholder="昵称" v-model="uname"><br>
        <input type="text" class="userphone" placeholder="手机号" v-model="utul"><br>
        <input type="text" class="useremail" placeholder="邮箱" v-model="mail"><br>
        <input type="password" class="userpass" placeholder="密码" v-model="upass"><br>
        <input type="password" class="userpass" placeholder="确认密码" v-model="upass"><br>
        <input type="button" value="注册" class="register_btn" @click="register()"><br>
        <input type="button" value="去登录" class="login_btn"  @click="fun()"><br>
  </div>
</template>

<script>
// 引用axios请求
import link from "@/apis/link";
export default {
    name:"Registercontent",
    data(){
        return{
            
                uname:"",
                upass:"",
                utul:"",
                mail:"",
            
        }
    },
     methods:{
        fun(){
            this.$router.push("/login")
        },
        register(){
            
            link("/user/regist","post",{},{
                uname:this.uname,
                upass:this.upass,
                utel:this.utul,
                mail:this.mail,
                
            }).then((ok)=>{
                console.log(ok);
                setTimeout(()=>{
                    this.$router.push("/login")
                },2000)
            }).catch((err)=>{
            })
        }
    },

}

</script>

<style lang="scss" scoped>
    .register_content{
    margin-top: 0.2rem;
    font-size: 0.16rem;
}
    .register_content input{
        width: 3.66rem;
        height: 0.5rem;
        display: block;
        margin: auto;
        border: none;
        border-bottom: 0.01rem solid #e7e7e7;
    }
       .register_btn{
        width: 3.66rem;
        height: 0.35rem;
        display: block;
        margin: auto;
        border: none;
        color: white;
        background-color: #9fceff;
    }
    .pass_btn{
       display: block;
       margin: auto;
       background-color: white;
       border: none;
       color: #2e96ff;
    }
</style>